import request from '@/utils/request.js'

export const articleGetService = () => request.get('/my/cate/list')

// 添加分类
export const articleAddService = (data) => request.post('my/cate/add', data)

// 编辑分类
export const articleEditService = (data) => request.put('my/cate/info', data)

// 删除分类
export const articleDelService = (id) =>
  request.delete('/my/cate/del', {
    params: { id }
  })

// 获取文章列表
export const articleGetListService = (params) =>
  request.get('/my/article/list', {
    params
  })

//更新文章
export const articleUpdate = (obj) => {
  request.put('/my/article/info', {
    params: {
      ...obj
    }
  })
}

//发布文章
export const articlePublishService = (data) =>
  request.post('my/article/add', data)

// 获取文章详情
export const articleGetDetailService = (id) =>
  request.get('/my/article/info', {
    params: { id }
  })

//编辑文章
export const artEditService = (data) => request.put('/my/article/info', data)
